<template>
    <div class="son">
        <h3>我是son.vue</h3>
        <button @click="toFather">点我给父组件传值</button>
    </div>
</template>

<script>
export default {

    methods: {
        toFather () {
            // 子传父
            this.$emit('getMsg', '子给的数据')
        }
    }
}
</script>

<style>
    .son {
        width: 460px;
        height: 280px;
        border: 1px solid #000;
    }
</style>